package com.whiteape.book.ui.adapter;

import android.view.View;
import android.view.ViewGroup;

import com.whiteape.book.model.bo.TypefaceBo;
import com.whiteape.book.ui.adapter.holder.TypefaceHolder;
import com.whiteape.book.ui.base.EasyAdapter;
import com.whiteape.book.ui.base.adapter.IViewHolder;


/**
 * Created by newbiechen on 17-6-5.
 */

public class TypefaceManageAdapter extends EasyAdapter<TypefaceBo> {
    View.OnClickListener listener;

    @Override
    protected IViewHolder<TypefaceBo> onCreateViewHolder(int viewType) {
        return new TypefaceHolder();
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        View view = super.getView(position, convertView, parent);
        TypefaceHolder holder = (TypefaceHolder) view.getTag();
        holder.getAction().setTag(position);
        holder.getAction().setOnClickListener(listener);
//        view.setOnClickListener(listener);
        return view;
    }

    public void setListener(View.OnClickListener listener) {
        this.listener = listener;
    }
}
